function W = welfare_corner_homogeneous_subsidies(mu,B,A,P,rho,lambda_rnd,lambda_tech,s)

%% Compute welfare for a given level of the subsidy.

n = length(A);

%% Compute output (lower level of the bilevel optimization problem).
q = output_corner(mu,B,A,P,rho,lambda_rnd,lambda_tech,s*ones(n,1));

%% Compute welfare (upper level objective function of the bilevel optimization problem).
%W = mu'*q - q'*(rho/2*B - lambda_rnd*A - lambda_tech*P)*q + q'*(lambda_rnd*A + lambda_tech*P)*s - 1/2*s'*s;
W = mu'*q - q'*(rho/2*B - lambda_rnd*A - lambda_tech*P)*q + q'*(lambda_rnd*A + lambda_tech*P)*s*ones(n,1) - n/2*s^2;
